# -*- coding: utf-8 -*
from django.db import models
from django.contrib import admin


class BlogPosts(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=150)
    body = models.TextField()
    timestamp = models.DateTimeField()
    
class SiteUser(models.Model):
    username=models.CharField(max_length=30,primary_key=True)
    password=models.CharField(max_length=30)
    image=models.CharField(max_length=100)
    phone=models.CharField(max_length=30)
    email=models.CharField(max_length=30)
    last_login_time = models.DateTimeField()
    isactive=models.BooleanField(default=False)

class BlogPostAdmin(admin.ModelAdmin):
    list_display = ('title','timestamp')
    

class Author(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=150)
    name = models.CharField(max_length = 100)
    pub_time = models.DateTimeField()
    
class Book(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=100)
    genre = models.CharField(max_length=100)
    num_pages = models.IntegerField()
    authors = models.ManyToManyField(Author)
    
class Newsbase(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=100)
    image = models.CharField(max_length=100)
    author = models.CharField(max_length=100)
    pub_time = models.DateTimeField()
    content = models.CharField(max_length=9999)
    
'''class Authoring(models.Model):
    collaboration_type = models.CharField(max_length=100)
    book = models.ForeignKey(Book)
    author = models.ForeignKey(Author)'''

class Message(models.Model):
    id = models.IntegerField(primary_key=True)
    email = models.CharField(max_length=100,blank=True, null=True)
    subject = models.CharField(max_length=100,blank=True, null=True)
    author = models.CharField(max_length=100,blank=True, null=True)
    content = models.CharField(max_length=9999,blank=True, null=True)
    sendtime = models.DateTimeField()
    issolve = models.IntegerField(blank=True, null=True)



class nodebook(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=100, blank=True, null=True)
    image = models.CharField(max_length=100, blank=True, null=True)
    price = models.FloatField(max_length=15, blank=True, null=True)
    pt = models.CharField(max_length=100, blank=True, null=True)
    pp = models.CharField(max_length=100, blank=True, null=True)
    czxt = models.CharField(max_length=100, blank=True, null=True)
    xh = models.CharField(max_length=100, blank=True, null=True)
    clqxl = models.CharField(max_length=100, blank=True, null=True)
    clqxh = models.CharField(max_length=100, blank=True, null=True)
    clqzp = models.CharField(max_length=100, blank=True, null=True)
    sjhc = models.CharField(max_length=100, blank=True, null=True)
    ncrl = models.CharField(max_length=100, blank=True, null=True)
    nclx = models.CharField(max_length=100, blank=True, null=True)
    yprl = models.CharField(max_length=100, blank=True, null=True)
    gqlx = models.CharField(max_length=100, blank=True, null=True)
    xspcc = models.CharField(max_length=100, blank=True, null=True)
    xspb = models.CharField(max_length=100, blank=True, null=True)
    xspfbl = models.CharField(max_length=100, blank=True, null=True)
    bgjs = models.CharField(max_length=100, blank=True, null=True)
    xklx = models.CharField(max_length=100, blank=True, null=True)
    xkxp = models.CharField(max_length=100, blank=True, null=True)
    xkrl = models.CharField(max_length=100, blank=True, null=True)
    ypxt = models.CharField(max_length=100, blank=True, null=True)
    ysq = models.CharField(max_length=100, blank=True, null=True)
    mkf = models.CharField(max_length=100, blank=True, null=True)
    sxt = models.CharField(max_length=100, blank=True, null=True)
    wxjyw = models.CharField(max_length=100, blank=True, null=True)
    jywlx = models.CharField(max_length=100, blank=True, null=True)
    sjjk = models.CharField(max_length=100, blank=True, null=True)
    spjk = models.CharField(max_length=100, blank=True, null=True)
    ypjk = models.CharField(max_length=100, blank=True, null=True)
    ptjk = models.CharField(max_length=100, blank=True, null=True)
    dkq = models.CharField(max_length=100, blank=True, null=True)
    dclx = models.CharField(max_length=100, blank=True, null=True)
    xhsj = models.CharField(max_length=100, blank=True, null=True)
    wxcc = models.CharField(max_length=100, blank=True, null=True)
    zl = models.CharField(max_length=100, blank=True, null=True)


class desktop(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=100, blank=True, null=True)
    image = models.CharField(max_length=100, blank=True, null=True)
    price = models.FloatField(max_length=15, blank=True, null=True)
    type = models.CharField(max_length=100, blank=True, null=True)
    operation = models.CharField(max_length=50)
    mbchip = models.CharField(max_length=100, blank=True, null=True)
    cpusir = models.CharField(max_length=100, blank=True, null=True)
    cputype = models.CharField(max_length=100, blank=True, null=True)
    cpufre = models.CharField(max_length=100, blank=True, null=True)
    cpumax = models.CharField(max_length=100, blank=True, null=True)
    bus = models.CharField(max_length=100, blank=True, null=True)
    secmem = models.CharField(max_length=100, blank=True, null=True)
    thimem = models.CharField(max_length=100, blank=True, null=True)
    core = models.CharField(max_length=100, blank=True, null=True)
    corenum = models.CharField(max_length=100, blank=True, null=True)
    makesize = models.CharField(max_length=100, blank=True, null=True)
    memsize = models.IntegerField()
    memtype = models.CharField(max_length=100, blank=True, null=True)
    disksize = models.IntegerField()
    diskdis = models.CharField(max_length=100, blank=True, null=True)
    cdromtype = models.CharField(max_length=100, blank=True, null=True)
    cdromdis = models.CharField(max_length=100, blank=True, null=True)
    graphictype = models.CharField(max_length=100, blank=True, null=True)
    graphiccore = models.CharField(max_length=100, blank=True, null=True)
    graphicmem = models.CharField(max_length=100, blank=True, null=True)
    graphicdis = models.CharField(max_length=100, blank=True, null=True)
    screensize = models.CharField(max_length=100, blank=True, null=True)
    screenresolution = models.CharField(max_length=100, blank=True, null=True)
    screendis = models.CharField(max_length=100, blank=True, null=True)
    net = models.CharField(max_length=100, blank=True, null=True)
    usbinterface = models.CharField(max_length=100, blank=True, null=True)
    audiointerface = models.CharField(max_length=100, blank=True, null=True)
    videointerface = models.CharField(max_length=100, blank=True, null=True)
    netinterface = models.CharField(max_length=100, blank=True, null=True)
    otherinterface = models.CharField(max_length=100, blank=True, null=True)
    reader = models.CharField(max_length=100, blank=True, null=True)
    power = models.CharField(max_length=100, blank=True, null=True)
    chassistype = models.CharField(max_length=100, blank=True, null=True)
    chassiscolor = models.CharField(max_length=100, blank=True, null=True)
class ultrebook(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=100, blank=True, null=True)
    url = models.CharField(max_length=100, blank=True, null=True)
    image = models.CharField(max_length=100, blank=True, null=True)
    price = models.FloatField(max_length=15, blank=True, null=True)
    pubtime = models.DateTimeField()
    type = models.CharField(max_length=100, blank=True, null=True)
    pubfor = models.CharField(max_length=100, blank=True, null=True)
    operation = models.CharField(max_length=50)
    mbchip = models.CharField(max_length=100, blank=True, null=True)
    cpusir = models.CharField(max_length=100, blank=True, null=True)
    cputype = models.CharField(max_length=100, blank=True, null=True)
    cpumax = models.CharField(max_length=100, blank=True, null=True)
    bus = models.CharField(max_length=100, blank=True, null=True)
    thimem = models.CharField(max_length=100, blank=True, null=True)
    core = models.CharField(max_length=100, blank=True, null=True)
    gongyi = models.CharField(max_length=100, blank=True, null=True)
    gonghao = models.CharField(max_length=100, blank=True, null=True)
    memsize = models.IntegerField()
    memtype = models.CharField(max_length=100, blank=True, null=True)
    memmaxsize = models.IntegerField()
    disksize = models.IntegerField()
    diskdis = models.CharField(max_length=100, blank=True, null=True)
    cdromtype = models.CharField(max_length=100, blank=True, null=True)
    graphictype = models.CharField(max_length=100, blank=True, null=True)
    graphicmem = models.CharField(max_length=100, blank=True, null=True)
    screensize = models.CharField(max_length=100, blank=True, null=True)
    screenratio = models.CharField(max_length=100, blank=True, null=True)
    screenresolution = models.CharField(max_length=100, blank=True, null=True)
    lcd = models.CharField(max_length=100, blank=True, null=True)
    wireless = models.CharField(max_length=100, blank=True, null=True)
    wire = models.CharField(max_length=100, blank=True, null=True)
    shexiangtou = models.CharField(max_length=100, blank=True, null=True)
    sound = models.CharField(max_length=100, blank=True, null=True)
    mic = models.CharField(max_length=100, blank=True, null=True)
    audiointerface = models.CharField(max_length=100, blank=True, null=True)
    videointerface = models.CharField(max_length=100, blank=True, null=True)
    datainterface = models.CharField(max_length=100, blank=True, null=True)
    otherinterface = models.CharField(max_length=100, blank=True, null=True)
    weight = models.CharField(max_length=100, blank=True, null=True)
    power = models.CharField(max_length=100, blank=True, null=True)
    length = models.CharField(max_length=100, blank=True, null=True)
    wigth = models.CharField(max_length=100, blank=True, null=True)
    high = models.CharField(max_length=100, blank=True, null=True)
'''    
class onemachine(models.Model):
    id = models.IntegerField(primary_key=True)
    oname = models.CharField(max_length=100, blank=True, null=True)
    oprice = models.IntegerField()
    oprocessor = models.CharField(max_length=100, blank=True, null=True)
    omemory = models.CharField(max_length=100, blank=True, null=True)
    odisksize = models.CharField(max_length=100, blank=True, null=True)
    oinchsize = models.CharField(max_length=100, blank=True, null=True)
    ooperation = models.CharField(max_length=100, blank=True, null=True)
class desktop(models.Model):
    id = models.IntegerField(primary_key=True)
    bname = models.CharField(max_length=100, blank=True, null=True)
    bprice = models.IntegerField()
    bprocessor = models.CharField(max_length=100, blank=True, null=True)
    bgraph = models.CharField(max_length=50)
    bmemory = models.CharField(max_length=100, blank=True, null=True)
    bdisksize = models.CharField(max_length=100, blank=True, null=True)
    binchsize = models.CharField(max_length=100, blank=True, null=True)
    boperation = models.CharField(max_length=100, blank=True, null=True)
    bobjfor = models.CharField(max_length=100, blank=True, null=True)
    
class ultrebook(models.Model):
    id = models.IntegerField(primary_key=True)
    uname = models.CharField(max_length=100, blank=True, null=True)
    uprice = models.IntegerField()
    uthickness = models.IntegerField()
    uprocessor = models.CharField(max_length=100, blank=True, null=True)
    #ugraph = models.CharField(max_length=50)
    umemory = models.CharField(max_length=100, blank=True, null=True)
    udisksize = models.CharField(max_length=100, blank=True, null=True)
    uinchsize = models.CharField(max_length=100, blank=True, null=True)
    #uoperation = models.CharField(max_length=100, blank=True, null=True)
    #uobjfor = models.CharField(max_length=100, blank=True, null=True)
    uweight = models.IntegerField()
        
        
class flat(models.Model):
    id = models.IntegerField(primary_key=True)
    fname = models.CharField(max_length=100, blank=True, null=True)
    fprice = models.IntegerField()
    fmemory = models.CharField(max_length=100, blank=True, null=True)
    fdisksize = models.CharField(max_length=100, blank=True, null=True)
    finchsize = models.CharField(max_length=100, blank=True, null=True)
    finchdescription = models.CharField(max_length=100, blank=True, null=True)
    fwifi = models.CharField(max_length=100, blank=True, null=True)
    foperation = models.CharField(max_length=100, blank=True, null=True)
    funion = models.CharField(max_length=100, blank=True, null=True)
 '''       
#admin.site.register(BlogPosts,BlogPostAdmin)
